<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

<h:head>
	<title><h:outputText value="#{msgs.datos_alumno}" /></title>
</h:head>
<f:view locale="en">
	<h:body>
		<h:messages id="mensajes" showDetail="true" showSummary="false" />
		<h:form>
			<h3><h:outputLabel value="#{msgs.datos_alumno}" /></h3>
			<h4><h:outputText value="#{alumnoView.useCaseMode}" /></h4>

			<rich:panel>
				<h:panelGrid columns="2">
					<h:column>
						<h:outputText value="#{msgs.nombre}" />
					</h:column>
					<h:column>
						<h:outputLabel value="#{alumnoView.alumno.nombre}"
							rendered="#{alumnoView.modoConsulta or alumnoView.modoEliminar}" />
						<h:inputText id="nombreAlumno" value="#{alumnoView.alumno.nombre}"
							required="true" requiredMessage="#{msgs.error_requerido}"
							rendered="#{!alumnoView.modoConsulta and !alumnoView.modoEliminar}">
							<f:converter for="nombreAlumno" converterId="stringConverter" />
						</h:inputText>
					</h:column>
					<h:column>
						<h:outputText value="#{msgs.apellido}" />
					</h:column>
					<h:column>
						<h:outputLabel value="#{alumnoView.alumno.apellido}"
							rendered="#{alumnoView.modoConsulta or alumnoView.modoEliminar}" />
						<h:inputText id="apellidoAlumno"
							value="#{alumnoView.alumno.apellido}" required="true"
							requiredMessage="#{msgs.error_requerido}"
							rendered="#{!alumnoView.modoConsulta and !alumnoView.modoEliminar}">
							<f:converter for="apellidoAlumno" converterId="stringConverter" />
						</h:inputText>
					</h:column>
					<h:column>
						<h:outputText value="#{msgs.telefono}" />
					</h:column>
					<h:column>
						<h:outputLabel value="#{alumnoView.alumno.telefono}"
							rendered="#{alumnoView.modoConsulta or alumnoView.modoEliminar}" />
						<h:inputText value="#{alumnoView.alumno.telefono}"
							rendered="#{!alumnoView.modoConsulta and !alumnoView.modoEliminar}" />
					</h:column>
					<h:column>
						<h:outputText value="#{msgs.email}" />
					</h:column>
					<h:column>
						<h:outputLabel value="#{alumnoView.alumno.email}"
							rendered="#{alumnoView.modoConsulta or alumnoView.modoEliminar}" />
						<h:inputText id="alumnoEmail" value="#{alumnoView.alumno.email}"
							rendered="#{!alumnoView.modoConsulta and !alumnoView.modoEliminar}">
							<f:validator for="alumnoEmail" validatorId="validaEmail" />
						</h:inputText>
					</h:column>
				</h:panelGrid>
			</rich:panel>
			<h:panelGrid columns="5">
				<h:column>
					<h:commandButton value="#{msgs.salir}" immediate="true"
						action="#{alumnoListener.salir}" />
				</h:column>
				<h:column>
					<h:commandButton value="#{msgs.volver}" immediate="true"
						action="#{alumnoListener.volver}" />
				</h:column>
				<h:column>
					<h:commandButton value="#{msgs.guardar}"
						action="#{alumnoListener.guardar}"
						rendered="#{!alumnoView.modoConsulta and !alumnoView.modoEliminar}" />
				</h:column>
				<h:column>
					<h:commandButton value="#{msgs.eliminar}"
						action="#{alumnoListener.guardar}"
						rendered="#{alumnoView.modoEliminar}" />
				</h:column>
			</h:panelGrid>
		</h:form>
	</h:body>
</f:view>
</html>